package cn.itcast.springboot.listener;

import cn.itcast.springboot.config.RabbitConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MyListener {
    @RabbitListener(queues = RabbitConfig.QUEUE1)
    public void myListener1(String msg){
        System.out.println("myListener1-消息队列读取："+msg);
    }

    @RabbitListener(queues = RabbitConfig.QUEUE2)
    public void myListener2(String msg){
        System.out.println("myListener2-消息队列读取："+msg);
    }
}
